<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /*other-->boolean Boolean();
        五种情况为false
        "",0,NaN,undefined,null-->false*/
        var a = "hello";
        var b = 20;
        console.log(Boolean(a));
        console.log(Boolean(b));
        console.log(""==0);
        console.log(undefined == null);
        /* 在有一边是数字类型做比较运算时，先将两边都转成数字类型.
        ""-->0;"abc"-->NaN;
        NaN和任何数据做！=判断时，返回为true
        */
        console.log(""==NaN);
        console.log(0==NaN);
        /* 在有一边是object时，底层运用Object.valueOf(null)判断*/
        console.log(""==null);
        console.log(String.valueOf("")==Object.valueOf(null));

        console.log(Number(null));
        // 0
        console.log(Number(undefined));
        // NaN
        console.log(Number(""));
        // 0
        console.log("" == undefined);

        console.log(typeof "");
        console.log(typeof null);
        console.log(typeof undefined);
        console.log(typeof NaN);
        
        
    </script>
    <!-- 
        1.一边的值为boolean，那么先将boolean转成number再比较
        2.一边为字符串，一边为number，那么string转成number再比较
        3.null==undefined
        4.NaN与任何值计算，结果都为NaN
        NaN!=NaN时为true
        5.null和undefined比较之前不能将其转换成其他类型
     -->
</body>
</html>